let fs = require('fs');

let path = require('path')

let ws = fs.createWriteStream(path.resolve(__dirname,'name1.txt'),{
  flag:'w',
  encoding:'utf8',
  highWaterMark:5,
  autoClose: true,
  start:0,
});

let flag = ws.write(123+' ',(err)=>{
  console.log(err)
})
console.log(flag)

ws.on('drain',()=>{
  console.log('抽干')
})
